package com.ctgu.mapper;

import com.ctgu.entity.UserEntity;
import org.apache.ibatis.annotations.MapKey;
import org.apache.ibatis.annotations.Param;

import java.util.List;
import java.util.Map;

/**
 * @author ALEX
 * @since 2022/9/11 16:55
 */
public interface UserMapper {
    UserEntity getUserById(Integer id);

    List<UserEntity> getAllUser(Integer pageNum,Integer pageSize);

    List<UserEntity> getUserByLike(@Param("username") String username);

    List<UserEntity> getUserByTableName(@Param("tableName") String tableName);

    Integer getUserCount();

    Integer insertUser(UserEntity userEntity);

    Integer updateUsernameById(@Param("id") Integer id, @Param("username") String username);

    Integer deleteUserById(@Param("id") Integer id);

    Integer deleteMoreUser(@Param("ids") String ids);

    UserEntity login(Map<String,Object> map);

    @MapKey("id")
    Map<String, Object> getUserByIdMap(@Param("id") Integer id);

    @MapKey("id")
    List<Map<String,Object>> getAllUserMap();

    @MapKey("id")
    Map<String,Object> getAllUserMap2();

    List<UserEntity> getAllUserByPage(Integer pageNum, Integer pageSize);
}